package se.wangs.proxydemo;

/**
 * -- coding: UTF-8 -- *
 *
 * @author wangs
 * @date 2023/12/13 13:59
 * @description 代理者
 */
public class CookProxy implements Alive{
    private Alive alive;

    public CookProxy(Alive alive) {
        this.alive = alive;
    }
    @Override
    public void eat() {
        // 代理内容
        System.out.println("先做饭...");
        System.out.println("饭做好了...");
        // 调用委托者的核心方法
        alive.eat();
    }
}
